-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add custom PatchMethod class to use http PATCH requests with the Nextcloud SSO api #8818
add custom PatchMethod class to use http PATCH requests with the Nextcloud SSO api #8818
Conversation
…cloud SSO api Signed-off-by: binsky <timo@binsky.org>
@@ -0,0 +1,117 @@ | |||
package com.nextcloud.android.sso; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add license header.
If this is a copy from PostMethod please also note this somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't had to do a lot with licenses yet. @tobiasKaminsky Do you think that's okay?
Do I need that author and copyright part?
/*
* Nextcloud SingleSignOn
*
* @author Timo Triebensky
* Copyright (C) 2021 Timo Triebensky
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* More information here: https://github.com/abeluck/android-streams-ipc
*
* ====================================================================
*
* The required methods of this class are copied and customized from PostMethod.
*/
import java.util.Vector; | ||
|
||
public class PatchMethod extends PostMethod { | ||
// -------------------------------------------------------------- Constants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we do not use such kind of comments, please remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it
/** | ||
* Log object for this class. | ||
*/ | ||
private static final Log LOG = LogFactory.getLog(PatchMethod.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use another log approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, Log_OC. I removed the log method that i took over from the parent class
* @since 2.0beta1 | ||
*/ | ||
protected boolean hasRequestContent() { | ||
LOG.trace("enter PatchMethod.hasRequestContent()"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove those logs, as we do not need them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it
* <p>This method must be overwritten by sub-classes that implement | ||
* alternative request content input methods</p> | ||
* | ||
* @since 2.0beta1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is from c&p I assume, so please remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adopt to our code syntax
Signed-off-by: binsky <timo@binsky.org>
Cool, thanks for your code changes. |
…SSO api Signed-off-by: binsky <timo@binsky.org>
@tobiasKaminsky do i have to do anything else? |
stable-IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/2195-IT-stable-09-52 |
CodacyLint
SpotBugs (new)
SpotBugs (master)
|
Nope, merged and thank you very much for this @binsky08 💙 |
should solve nextcloud/Android-SingleSignOn#355
Seems like the used org.apache.commons.httpclient is end of life: https://hc.apache.org/httpclient-legacy/
Therefore I created a PatchMethod class based on the official PostMethod class. It works. :)
Testing
Writing tests is very important. Please try to write some tests for your PR.
If you need help, please do not hesitate to ask in this PR for help.
unit tests
instrumented tests
UI tests